﻿using GalaSoft.MvvmLight;

namespace mal.balades.SlideShow.ViewModel
{
    /// <summary>
    /// This class contains properties that a View can data bind to.
    /// <para>
    /// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
    /// </para>
    /// <para>
    /// You can also use Blend to data bind with the tool's support.
    /// </para>
    /// <para>
    /// See http://www.galasoft.ch/mvvm/getstarted
    /// </para>
    /// </summary>
    public class ImageViewModel : ViewModelBase
    {
        #region Fields
        private string imageUrl;
        private string title;
       
        #endregion

        #region Construction / Destruction
        /// <summary>
        /// Initializes a new instance of the ImageViewModel class.
        /// </summary>
        public ImageViewModel()
        {
            if (IsInDesignMode)
            {
               
               
            }
            else
            {
                // Code runs "for real": Connect to service, etc...
            }
        }
        #endregion

        #region enum, struct, class

        #endregion

        #region Properties
        public string Title
        {
            get { return title; 
                //return "Mmmmmmmmm Mmmmmmmmm Mmmmmmmmmm Mmmmmmmmmm ";
            }
            set
            {
                if (title != value)
                {
                    title = value;
                    RaisePropertyChanged("Title");
                }
            }
        }

        public string ImageUrl
        {
            get { return imageUrl; }
            set
            {
                if (imageUrl != value)
                {
                    imageUrl = value;
                    RaisePropertyChanged("ImageUrl");
                }
            }
        }


        public int FontSize
        {
            get 
            {
                if (title.Length > 35)
                    return 25;
                else if (title.Length > 30)
                    return 27;
                else if (title.Length > 25)
                    return 30;
                else if (title.Length > 20)
                    return 33;
                else
                    return 35;
            }
           
        }
        #endregion

        #region Methods

        #endregion

        #region Events

        #endregion


        

        ////public override void Cleanup()
        ////{
        ////    // Clean own resources if needed

        ////    base.Cleanup();
        ////}
    }
}